import java.rmi.*;
import java.util.*;
import java.rmi.server.*;

public class TransactionManager extends UnicastRemoteObject implements Server {
	Resource noss, db;
	
	public TransactionManager() throws Exception {
		noss = new Noss();
		db = new CorporateDatabase();
		ReplyManager replyManager = ReplyManager.getReplyManager();
		UpdateManager update = new UpdateManager(this, db);
		
	}
	
   public void print(String msg) throws RemoteException {
			System.out.println(msg);
	}	
	
	public Worker getWorker() throws RemoteException {
		TransactionWorker worker = null;
		try {
			worker = new TransactionWorker(db,noss);
		}
		catch (Exception e){
			System.out.println(e);
		}
		
		return worker;
	}

}
